import matplotlib.pyplot as plt
import pandas as pd
import pymysql
import numpy as np

import matplotlib.pyplot as plt
import numpy as np

x = np.linspace(-1,1,50)
y1 = x ** 2
y2 = x * 2
#简单的使用
l1, = plt.plot(x, y1, label='linear line')
l2, = plt.plot(x, y2, color='red', linewidth=1.0, linestyle='--', label='square line')

#简单的设置legend(设置位置)
#位置在右上角
plt.legend(loc = 'upper right')
plt.show()
